﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="MonHoc.aspx.cs" Inherits="WTSQCB.MonHoc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp; Quản lý môn học</p>
    <p>
        &nbsp;
        Chọn Khoa:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="Khoaddl" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="TenKhoa" DataValueField="MaKhoa" Width="150px" OnSelectedIndexChanged="Khoaddl_SelectedIndexChanged">
        </asp:DropDownList>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Chọn Bộ môn:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="BoMonddl" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="TenBoMon" DataValueField="MaBoMon" Width="150px">
        </asp:DropDownList>
    </p>
    <p>
        <asp:GridView ID="MonHocdgv" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaMonHoc" DataSourceID="SqlDataSource3" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="1035px" Height="431px">
            <Columns>
                <asp:CommandField ButtonType="Button" SelectText="CHỌN" ShowSelectButton="True" />
                <asp:BoundField DataField="MaMonHoc" HeaderText="Mã môn học" ReadOnly="True" SortExpression="MaMonHoc" />
                <asp:BoundField DataField="TenMonHoc" HeaderText="Tên môn học" SortExpression="TenMonHoc" />
                <asp:BoundField DataField="SoTietLiThuyet" HeaderText="ST lý thuyết" SortExpression="SoTietLiThuyet" />
                <asp:BoundField DataField="SoTietThucHanh" HeaderText="ST thực hành" SortExpression="SoTietThucHanh" />
                <asp:BoundField DataField="SoTietThaoLuan" HeaderText="ST thảo luận" SortExpression="SoTietThaoLuan" />
                <asp:BoundField DataField="SoTietTuHoc" HeaderText="ST tự học" SortExpression="SoTietTuHoc" />
                <asp:BoundField DataField="TongSoTiet" HeaderText="Tổng số tiết" SortExpression="TongSoTiet" />
                <asp:BoundField DataField="SoDVHT" HeaderText="Số ĐVHT" SortExpression="SoDVHT" />
                <asp:BoundField DataField="TenBoMon" HeaderText="Tên bộ môn" SortExpression="TenBoMon" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
    </p>
    <p>
        &nbsp;
        <asp:Button ID="Thembtn" runat="server" OnClick="Thembtn_Click" Text="THÊM" Width="80px" />
        &nbsp;
        <asp:Button ID="Suabtn" runat="server" OnClick="Suabtn_Click" style="width: 43px" Text="SỬA" Width="80px" />
        &nbsp;
        <asp:Button ID="Xoabtn" runat="server" OnClick="Xoabtn_Click" OnClientClick="return confirm('Bạn muốn XÓA không ?')" Text="XÓA" Width="80px" />
    </p>
    <p>
        &nbsp;
        Thông tin chi tiết:</p>
    <p>
        &nbsp;
        Mã môn học:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="MaMonHoctxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaMonHoctxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Mã môn học không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Tên môn học:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TenMonHoctxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TenMonHoctxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Tên môn học khọng được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Số tiết lí thuyết:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
        <asp:TextBox ID="STLTtxt" runat="server" Width="200px" OnTextChanged="STLTtxt_TextChanged"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="STLTtxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    &nbsp;<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="STLTtxt" ErrorMessage="RangeValidator" ForeColor="Red" MaximumValue="120" MinimumValue="0" Type="Integer">0 - 120</asp:RangeValidator>
    </p>
    <p>
        &nbsp;
        Số tiết thực hành:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="STTHtxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="STTHtxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    &nbsp;<asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="STTHtxt" ErrorMessage="RangeValidator" ForeColor="Red" MaximumValue="120" MinimumValue="0" Type="Integer">0 - 120</asp:RangeValidator>
    </p>
    <p>
        &nbsp;
        Số tiết thảo luận:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="STTLtxt" runat="server" Width="200px" OnTextChanged="STTLtxt_TextChanged"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="STTLtxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    &nbsp;<asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="STTLtxt" ErrorMessage="RangeValidator" ForeColor="Red" MaximumValue="120" MinimumValue="0" Type="Integer">0 - 120</asp:RangeValidator>
    </p>
    <p>
        &nbsp;
        Số tiết tự học:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="STTHoctxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="STTHoctxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    &nbsp;<asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="STTHoctxt" ErrorMessage="RangeValidator" ForeColor="Red" MaximumValue="120" MinimumValue="0" Type="Integer">0 - 120</asp:RangeValidator>
    </p>
    <p>
        &nbsp;
        Số đơn vị học trình:&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="SDVHTtxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="SDVHTtxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    &nbsp;<asp:RangeValidator ID="RangeValidator5" runat="server" ControlToValidate="SDVHTtxt" ErrorMessage="RangeValidator" ForeColor="Red" MaximumValue="10" MinimumValue="1" Type="Integer">1 - 10</asp:RangeValidator>
    </p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT * FROM [Khoa]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="BoMonLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="Khoaddl" Name="makhoa" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="MonHocLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="BoMonddl" Name="mabomon" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>
